<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8"/>
	<title>贷款运营管理平台</title>
	<meta name="renderer" content="webkit"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta http-equiv="Access-Control-Allow-Origin" content="*"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="format-detection" content="telephone=no"/>
	<link rel="icon" href="favicon.ico"/>
	<link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all" />
	<link rel="stylesheet" href="//at.alicdn.com/t/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" th:href="@{/css/login.css}" media="all" />
</head>
<body class="main_body">


	<div class="login-main">
		<header class="layui-elip">贷款管理平台</header>
		<form action="index.html" class="layui-form">
			<div class="layui-input-inline">
				<input type="text" name="username" lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-input-inline">
				<input type="password" name="password" lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-input-inline login-btn">
				<button type="submit" class="layui-btn" lay-submit lay-filter="login">登录</button>
			</div>
			<hr/>
		</form>
	</div>
	<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
	<script type="text/javascript">
        layui.use(['form', 'layer'], function() {
            var form = layui.form(),
                layer = layui.layer,
                $ = layui.jquery;

            // 表单提交监听
            form.on('submit(login)', function(data) {
                // 提交请求
                $.post("/dologin", data.field, function(res) {
                    // 提示信息
                    layer.msg(res.message, {
                        time: 1000
                    }, function() {
                        if (res.code == 200) {
                            window.location.href = '/admin';
                        }
                    });

                });
                return false;
            });

        });
	</script>

</body>
</html>